package com.xuecheng.base.exception;

public class XueChengPlusException extends RuntimeException{
    private String errMessage;
    private String errCode;
    public XueChengPlusException(){
        super();
    }
    public XueChengPlusException(String errMessage){
        super(errMessage);
        this.errMessage = errMessage;
    }
    public XueChengPlusException(String errCode,String errMessage){
        super(errMessage);
        this.errMessage = errMessage;
        this.errCode = errCode;
    }

    public static void cast(String errCode, String errMessage) {
      throw new XueChengPlusException(errCode,errMessage);
    }

    public String getErrMessage(){
        return errMessage;
    }
    public String getErrCode(){
        return errCode;
    }
    public static void cast(CommonError commonError){
        throw new XueChengPlusException(commonError.getErrMessage());
    }
    public static void cast(String errMessage){
        throw new XueChengPlusException(errMessage);
    }
}
